<?php
	 session_start();
	extract($_REQUEST);
	require_once("includes/constants.php");
	require_once("includes/database.php");
		
	
	if (deleteFabric($_SESSION[FABRICS][$selectedFabric]['f_fabric_id']) != 0) {
		$confirmationMessage = $_SESSION[FABRICS][$selectedFabric]['f_name'] .			" has been removed from the fabrics list." ;
		getAllFabrics(); //update fabric list in session 
		header( 'Location: confirmationPage.php?' . "confirmationMessage=" .$confirmationMessage) ;
		//require("confirmationPage.php");
	}
	else {
		$errorMessage = "An error occured while trying to remove $_SESSION[FABRICS][$selectedFabric]['$f_name'] from records..";
		header( 'Location: errorPage.php?' . "errorMessage=" . $errorMessage ) ;
		//require("errorPage.php");
		//checking svn difference
	}	
	;

?>
